package com.geor.gcv.core.model;

import java.util.ArrayList;
import java.util.List;
/**
 * 连通域  团  辅助
 * @author geor.lusongnan
 *
 */
public class Cluster {
	public int min;
	public int max;
	public int tag;
	public int row;
	public int level;
	public List<Integer> tags = new ArrayList<Integer>();

	public Cluster(int min, int max, int tag, int row, int level) {
		super();
		this.min = min;
		this.max = max;
		this.tag = tag;
		this.row = row;
		this.level = level;
	}

	public Cluster(int min, int max) {
		super();
		this.min = min;
		this.max = max;
	}

	public boolean compare(Cluster run) {
		if (run.min == this.min || run.min == this.max || run.max == this.min || run.max == this.max) {
			boolean flag = false;
			for (int i : run.tags) {
				if (tags.contains(i)) {
					flag = true;
				}
			}

			return flag;
		}
		return false;
	}

	@Override
	public String toString() {
		return "(" + min + "," + max + ")" + ":" + tags + ",行:" + row;
	}

}
